import request from "@/utils/request.js";

/**
 * 给机构添加新项目
 * @param params
 * @returns {AxiosPromise}
 */
export function addOrgProject(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/addOrgProject",
    method: "post",
    data: params
  });
}

/**
 * 操作日志
 * @param params
 * @returns {AxiosPromise}
 */
export function listOperateLog(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/listOperateLog",
    method: "post",
    data: params
  });
}

/**
 * 机构关联的所有项目
 * @param params
 * @returns {AxiosPromise}
 */
export function listProjectByOrgId(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/listProjectByOrgId",
    method: "post",
    data: params
  });
}

/**
 * 可用项目列表
 * @param params
 * @returns {AxiosPromise}
 */
export function listProject(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/listProjectDict",
    method: "post",
    data: params
  });
}

/**
 * 人员字典
 * @param params
 * @returns {AxiosPromise}
 */
export function listUserDict(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/listUserDict",
    method: "post",
    data: params,
    closeLoading: true
  });
}

/**
 * 项目节点设置
 * @param params
 * @returns {AxiosPromise}
 */
export function setupNode(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/setupNode",
    method: "post",
    data: params
  });
}

/**
 * 添加或者修改项目模板
 * @param params
 * @returns {AxiosPromise}
 */
export function addOrUpdate(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/template/addOrUpdate",
    method: "post",
    data: params
  });
}

/**
 * 项目启用停用
 * @param params
 * @returns {AxiosPromise}
 */
export function changeUseFlag(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/template/changeUseFlag",
    method: "post",
    data: params
  });
}

/**
 * 项目列表
 * @param params
 * @returns {AxiosPromise}
 */
export function projectList(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/template/list",
    method: "post",
    data: params
  });
}

/**
 * 可用项目列表
 * @param params
 * @returns {AxiosPromise}
 */
export function listProjectDict(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/template/listProjectDict",
    method: "post",
    data: params
  });
}

/**
 * 可用项目节点列表
 * @param params
 * @returns {AxiosPromise}
 */
export function listProjectNodeDict(params) {
  return request({
    url:
      "/teachingPlatformService/api/org/project/template/listProjectNodeDict",
    method: "post",
    data: params,
    closeLoading: true
  });
}

/**
 * 目标达成统计
 * @param params
 * @returns {AxiosPromise}
 */
export function countReachTheGoal(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/dashboard/countReachTheGoal",
    method: "post",
    data: params
  });
}

/**
 * 数据汇总统计
 * @param params
 * @returns {AxiosPromise}
 */
export function dataSummary(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/dashboard/dataSummary",
    method: "post",
    data: params
  });
}

/**
 * 列出所有项目下的机构
 * @param params
 * @returns {AxiosPromise}
 */
export function listAll(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/dashboard/listAll",
    method: "post",
    data: params
  });
}
/**
 * 给机构添加备注
 * @param params
 * @returns {AxiosPromise}
 */
export function addOrgRemake(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrgRemake/addOrgRemake",
    method: "post",
    data: params
  });
}
/**
 * 备注列表
 * @param params
 * @returns {AxiosPromise}
 */
export function listPage(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrgRemake/listPage",
    method: "post",
    data: params
  });
}
/**
 * 项目节点完成设置时间
 * @param params
 * @returns {AxiosPromise}
 */
export function setupNodeFinishTime(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/setupNodeFinishTime",
    method: "post",
    data: params
  });
}

/**
 * 项目设置节点计划时间
 * @param params
 * @returns {AxiosPromise}
 */
export function setupNodePlanTime(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/setupNodePlanTime",
    method: "post",
    data: params
  });
}
/**
 * 设置负责人
 * @param params
 * @returns {AxiosPromise}
 */
export function setupNodeUser(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/manager/setupNodeUser",
    method: "post",
    data: params
  });
}

/**
 * 查询最后一条备注
 * @param params
 * @returns {AxiosPromise}
 */
export function listLastOne(params) {
  return request({
    url: "/teachingPlatformService/api/operatingOrgRemake/listLastOne",
    method: "post",
    data: params
  });
}

/**
 * 项目置顶
 * @param params
 * @returns {AxiosPromise}
 */
export function setTop(params) {
  return request({
    url: "/teachingPlatformService/api/org/project/template/setTop",
    method: "post",
    data: params
  });
}
